package com.yida.gwj.config.controller;

import com.yida.common.core.domain.R;
import com.yida.common.security.annotation.InnerAuth;
import com.yida.gwj.common.domain.GwjBaseBusinessNum;
import com.yida.gwj.common.service.IGwjBaseBusinessNumService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 基础业务编号
 *
 * @author liangp
 * @date 2023/04/20
 */
@Api(value = "基础业务编号", tags = "基础业务编号")
@RequestMapping("/businessNum")
@RestController
public class BaseBusinessNumController {
    private static final Logger log = LoggerFactory.getLogger(BaseBusinessNumController.class);

    @Autowired
    private IGwjBaseBusinessNumService baseBusinessNumService;

    @InnerAuth
    @ApiOperation(value = "获取下一个业务编号")
    @GetMapping("/inner/getNextNum")
    public R<GwjBaseBusinessNum> getNextNum(@RequestParam(value = "areaId") Long areaId, @RequestParam(value = "bizFlagId") Integer bizFlagId) {
        return R.ok(baseBusinessNumService.getNextNum(areaId, bizFlagId));
    }

}
